CC = gcc
XX = g++
C11 = -std=c++11 -lpthread
CFLAGS = -Wall -O -g
TARGET = ./testasync
.PHONY: clean

%.o:%.c
	$(CC) $(CFLAGS) -c $< -o $@

%.o:%.cpp
	$(XX) $(CFLAGS) -c $< -o $@

SOURCES = $(wildcard *.c *.cpp)
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))

$(TARGET):$(OBJS)
	$(XX) $(OBJS) -o $(TARGET) $(C11)
	chmod a+x $(TARGET)

clean:
	rm -rf *.o $(TARGET)